home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 5 / CHASSIS_ / TEXTRESI.C < prev    next >
Text File  |  1992-05-14  |  1KB  |  47 lines

  1. /************************************************************************************/
  2. /*    TextResizeProc                                                                    */
  3. /************************************************************************************/
  4.  
  5. #include "MyHeaders.h"
  6.  
  7. int TextResizeProc()
  8. {
  9.     int        TextResRetCode = 0;
  10.     div_t    r;                                    /* work area for division            */
  11.     
  12.     EraseRect (&windTbl[windSub].windRec.port.portRect);
  13.     
  14.     HideControl (windTbl[windSub].windCntlH[0]);
  15.     SizeControl (windTbl[windSub].windCntlH[0], 16,
  16.         windTbl[windSub].windRec.port.portRect.bottom -
  17.         windTbl[windSub].windRec.port.portRect.top - 13);
  18.     MoveControl (windTbl[windSub].windCntlH[0],
  19.         windTbl[windSub].windRec.port.portRect.right - 15,
  20.         windTbl[windSub].windRec.port.portRect.top - 1);
  21.     ShowControl (windTbl[windSub].windCntlH[0]);
  22.     
  23.     workRect = windTbl[windSub].windRec.port.portRect;
  24.     viewRect = workRect;
  25.     viewRect.right -= 16;
  26.     viewRect.top += 4;
  27.     viewRect.bottom -= 16;
  28.     
  29.     r = div ((viewRect.bottom - viewRect.top),
  30.             (**windTbl[windSub].windTEH[0]).lineHeight);
  31.     viewRect.bottom -= r.rem;
  32.     
  33.     destRect = viewRect;
  34.     destRect.right -= 6;
  35.     destRect.left += 6;
  36.     (**windTbl[windSub].windTEH[0]).viewRect = viewRect;
  37.     (**windTbl[windSub].windTEH[0]).destRect = destRect;
  38.     CursorSelect(NIL, NIL, watchCursor);    /* set the cursor    */
  39.     TECalText(windTbl[windSub].windTEH[0]);        
  40.                 
  41.     TESelView(windTbl[windSub].windTEH[0]);    /* scroll to carat    */
  42.     
  43.     InvalRect (&windTbl[windSub].windRec.port.portRect);
  44.  
  45.     return TextResRetCode;
  46. }
  47.